import pandas as pd

data = {
    "Method": ["NetSenseML", "AllReduce", "TopK-0.1", "NetSenseML", "AllReduce", "TopK-0.1"    , "NetSenseML", "AllReduce", "TopK-0.1"],
    "Model": ["ResNet18", "ResNet18", "ResNet18", "ResNet18", "ResNet18", "ResNet18",             "ResNet18", "ResNet18", "ResNet18" ],
    "Bottleneck Bandwidth": ["200Mbps", "200Mbps", "200Mbps", "500Mbps", "500Mbps", "500Mbps",   "800Mbps", "800Mbps", "800Mbps"],
    "Final Test Accuracy": ["75.79%", "67.34%", "66.52%", "76.02%", "73.24%", "75.62%",           "76.19%", "80.35%", "75.68%"],
    "平均训练带宽(Samples/second)": [642.90, 42.2, 65.31, 744.24, 179.85, 144.27,                    851.31, 283.6, 234.77],
    "最终收敛时间(s)": [1575, "N/A", "N/A", 1090, "N/A", "N/A",                                    1409, 3150, 1920],
}

df = pd.DataFrame(data)

# 将表格导出为 LaTeX 格式
latex_table = df.to_latex(index=False, caption="VGG Test Accuracy Comparison of Different Methods", label="tab:acc")
print(latex_table)
